<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
    <body>
        <h3>Product List</h3>
        <a href="controller?action=product_new">Insert New</a>
        <table border="1">
            <tr>
                <td>No</td>
                <td>Name</td>
                <td>Description</td>
                <td>Price</td>
                <td>Category</td>
            </tr>
            <c:set var="no" value="1"/>
            <c:forEach items="${products}" var="product">
                <tr>
                    <td>${no}</td>
                    <td>${product.name}</td>
                    <td>${product.description}</td>
                    <td>${product.price}</td>
                    <td>${product.category.name}</td>
                </tr>       
               <c:set var="no" value="${no+1}"/>
            </c:forEach>
        </table>
    </body>
</html>